<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>&lt;sys/msg.h&gt;</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_000_009_324">&nbsp;</a>NAME</h4><blockquote>
sys/msg.h - message queue structures
</blockquote><h4><a name = "tag_000_009_325">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

#include &lt;sys/msg.h&gt;
</code>
</pre>
</blockquote><h4><a name = "tag_000_009_326">&nbsp;</a>DESCRIPTION</h4><blockquote>
The &lt;<b>sys/msg.h</b>&gt; header defines the following constant
and members of the structure
<b>msqid_ds</b>.
<p>
The following data types are defined through
<b>typedef</b>:
<dl compact>

<dt><b>msgqnum_t</b><dd><index term="data type, msgqnum_t"></index>
Used for the number of messages in the message queue.

<dt><b>msglen_t</b><dd><index term="data type, msglen_t"></index>
Used for the number of bytes allowed in a message queue.

</dl>
<p>
These types are unsigned integer types that are able to store values at
least as large as a type
<b>unsigned short</b>.
<p>
Message operation flag:
<dl compact>

<dt>MSG_NOERROR<dd>
No error if big message.

</dl>
<p>
The structure
<b>msqid_ds</b>
contains the following members:
<pre>
<code>
struct ipc_perm msg_perm   operation permission structure
msgqnum_t       msg_qnum   number of messages currently on queue
msglen_t        msg_qbytes maximum number of bytes allowed on queue
pid_t           msg_lspid  process ID of last <i>msgsnd</i>()
pid_t           msg_lrpid  process ID of last <i>msgrcv</i>()
time_t          msg_stime  time of last <i>msgsnd</i>()
time_t          msg_rtime  time of last <i>msgrcv</i>()
time_t          msg_ctime  time of last change
</code>
</pre>
<p>
The
<b>pid_t</b>,
<b>time_t</b>,
<b>key_t</b>
and
<b>size_t</b>
types are defined as described in
<i><a href="systypes.h.html">&lt;sys/types.h&gt;</a></i>.
<p>
The following are declared as functions and may also be defined
as macros.
Function prototypes must be provided for use with an ISO C
compiler.
<pre>
<code>
int       <a href="msgctl.html">msgctl</a>(int, int, struct msqid_ds *);
int       <a href="msgget.html">msgget</a>(key_t, int);
ssize_t   <a href="msgrcv.html">msgrcv</a>(int, void *, size_t, long int, int);
int       <a href="msgsnd.html">msgsnd</a>(int, const void *, size_t, int);
</code>
</pre>
<p>
In addition, all of the symbols from
<i><a href="sysipc.h.html">&lt;sys/ipc.h&gt;</a></i>
will be defined when this header is included.
</blockquote><h4><a name = "tag_000_009_327">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_009_328">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_009_329">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="msgctl.html">msgctl()</a></i>,
<i><a href="msgget.html">msgget()</a></i>,
<i><a href="msgrcv.html">msgrcv()</a></i>,
<i><a href="msgsnd.html">msgsnd()</a></i>,
<i><a href="systypes.h.html">&lt;sys/types.h&gt;</a></i>.
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>
